package com.work.vo.transport;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.work.constant.DictBizConstant;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springblade.core.tool.utils.Func;
import org.springblade.system.cache.DictBizCache;

import java.time.LocalDate;

/**
 * des
 *
 * @author ：dujianyu
 * @since ：Created in 2024/5/15 15:15
 */
@Data
public class WorkArrangeLandVO {

    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "配工ID")
    private Long walId;

    @ApiModelProperty(value = "线号")
    private String lineNo;

    @ApiModelProperty(value = "日期")
    private LocalDate planDate;

    @ApiModelProperty(value = "时间段")
    private String timeSpace;

    @ApiModelProperty(value = "时间段")
    private String timeSpaceName;

    public String getTimeSpaceName() {
        if (Func.isNull(timeSpace)) {
            return null;
        }
        return DictBizCache.getValue(DictBizConstant.TIME_SPACE, timeSpace);
    }

    @ApiModelProperty(value = "装卸")
    private String loadType;

    @ApiModelProperty(value = "装卸")
    private String loadTypeName;

    public String getLoadTypeName() {
        if (Func.isNull(loadType)) {
            return null;
        }
        return DictBizCache.getValue(DictBizConstant.LOAD_TYPE, loadType);
    }

    @ApiModelProperty(value = "散杂")
    private String packageBulk;

    @ApiModelProperty(value = "散杂")
    private String packageBulkName;

    public String getPackageBulkName() {
        if (Func.isNull(packageBulk)) {
            return null;
        }
        return DictBizCache.getValue(DictBizConstant.PACKAGE_BULK, packageBulk);
    }

    @ApiModelProperty(value = "作业类型")
    private String landWorkType;

    @ApiModelProperty(value = "作业类型")
    private String landWorkTypeName;

    public String getLandWorkTypeName() {
        if (Func.isNull(landWorkType)) {
            return null;
        }
        return DictBizCache.getValue(DictBizConstant.LAND_WORK_TYPE, landWorkType);
    }

    @ApiModelProperty(value = "区域")
    private String areaNames;

}
